<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "{{%hj_child_flow}}".
 *
 * @property int $id 项目ID
 * @property int $flow_id 1初设阶段,2施工图阶段,3可研阶段,4项目建议书
 * @property int $project_child_id 项目关联ID
 * @property string $section 设计科室
 * @property int $flow_at 流程完成时间
 * @property string $flow_designer 流程完成者
 */
class ChildFlow extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%child_flow}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['flow_id', 'project_child_id', 'flow_at', 'complete_at', 'status', 'valid', 'checkStatus'], 'integer'],
        ];
    }

    public function getProjectChild(){
        return $this->hasOne(ProjectChild::class, ['id' => 'project_child_id']);
    }

    public function extraFields() {
        $fields['projectChild'] = function(){
            return  $this->projectChild;
        };
    }
}
